package interview.sync.array;/*

 */

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;

/**
 * @ClassName HashSetDemo
 * @Author Final
 * @Project DataStructures
 */
public class HashSetDemo {

    public static void main(String[] args) {
//        Set arrayList =new HashSet<>();
        Set arrayList=new CopyOnWriteArraySet();

        for (int i=0;i<30;i++){
            new Thread(()->{
                arrayList.add(UUID.randomUUID().toString().subSequence(0,8));
                System.out.println(arrayList);
            },String.valueOf(i)).start();
        }
    }
}
